home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / utility / utilmisc / queue.lzh / queue_3.1 / queue_library.h < prev    next >
C/C++ Source or Header  |  1996-11-28  |  2KB  |  82 lines

  1. /*
  2.    queue_library.h --- queue library internals.
  3.  
  4.    Copyright (c) 1995 SHW Wabnitz
  5.    Written by Bernhard Fastenrath (fasten@shw.com)
  6.  
  7.    This file may be distributed under the terms
  8.    of the GNU General Public License.
  9. */
  10.  
  11. #include <exec/types.h>
  12. #include <exec/lists.h>
  13. #include <exec/nodes.h>
  14. #include <exec/memory.h>
  15. #include <dos/dos.h>
  16. #include <dos/dosextens.h>
  17. #include <dos/filehandler.h>
  18.  
  19. #include <proto/exec.h>
  20. #include <proto/dos.h>
  21.  
  22. #include <stdlib.h>
  23. #include <string.h>
  24.  
  25. #include "queue.h"
  26.  
  27. #if !defined (__AROS__) /* for p-OS and AmigaOS */
  28.  
  29. #ifndef MEMF_PRIVATE
  30. #define MEMF_PRIVATE 0
  31. #endif
  32.  
  33. #ifndef MEMF_SHARED_READ
  34. #define MEMF_SHARED_READ 0
  35. #endif
  36.  
  37. #endif /* __AROS__ */
  38.  
  39. typedef struct List List;
  40. typedef struct Node Node;
  41. typedef struct MinNode MinNode;
  42. typedef struct MsgPort MsgPort;
  43. typedef struct Message Message;
  44. typedef struct SignalSemaphore Semaphore;
  45. typedef struct Task Task;
  46.  
  47. typedef struct {
  48.   Node        qn_Node;
  49.   List        qn_List;
  50.   ULONG        qn_Refs;
  51.   ULONG        qn_Read;
  52.   List        qn_Handles;
  53.   Semaphore    qn_Semaphore;
  54. } QueueNode;
  55.  
  56. /* bitmasks for qm_Status */
  57. #define QMS_ACTIVE   0x01
  58. #define QMS_INACTIVE 0x02
  59. #define QMS_REMOVED ( QMS_INACTIVE | 0x04 )
  60. #define QMS_MARKER  ( QMS_INACTIVE | 0x08 )
  61.  
  62. typedef struct {
  63.   MinNode       qh_MinNode;
  64.   USHORT        qh_Mode;
  65.   USHORT        qh_Pad;
  66.   QueueNode    *qh_QNode;
  67.   ULONG        qh_SigMask;
  68.   Task         *qh_SigTask;
  69.   union {
  70.     struct {
  71.       QMessage *qhl_Message;
  72.       MinNode   qhl_MinNode; /* same as qm_MinNode */
  73.       USHORT    qhl_Status;  /* same as qm_Status  */
  74.       USHORT    qhl_Pad;
  75.     } qhl;
  76.     struct {
  77.       List    qhs_ReplyList;
  78.       ULONG    qhs_MsgCount;
  79.     } qhs;
  80.   } qh_un;
  81. } QueueHandle;
  82.